package com.hgh.designmodel;

import com.hgh.designmodel.builder.Student;
import com.hgh.designmodel.builder.Student2;
import com.hgh.designmodel.builder.Student3;

import java.util.Date;

/**
 * @author: huguanghui
 * Created by huguanghui on 2018/7/1.
 * @Description:
 */
public class Main {
    //无参构造

    public static void main(String[] args){

        Student noArgConstruct = new Student();
        noArgConstruct.setAddress("宁波");
        noArgConstruct.setAge(11);
        noArgConstruct.setBirth(new Date());
        noArgConstruct.setName("hgh");
        noArgConstruct.setSex(1);

        Student2 student2 = new Student2("hgh");


        Student3 student3 = new Student3.Builder("hgh",11)
                .sex(1)
                .birth(new Date())
                .address("ningbo")
                .build();

         System.out.println(student3);

    }
}
